package servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author Miss Chen
 * @version 1.0
 * @date 2024年09月02日14:48
 */
@WebServlet(urlPatterns = "/life2",loadOnStartup = 2)
public class LifeTwoServlet extends HttpServlet {
    @Override
    public void init() throws ServletException {
        System.out.println("********注解版本初始化方法********");
    }

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("-------------执行核心业务逻辑--------------");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("-------------post请求-------------");
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("-------------get请求-------------");
    }

    @Override
    public void destroy() {
        System.out.println("正在销毁");
    }
}
